/**
 * 内部类实现单例模式
 */
public class Singleton {

    public static class HolderClass {
        private final static Singleton instance = new Singleton();
    }


    public static Singleton getInstance() {
        return HolderClass.instance;
    }


    public static void main(String[] args) {

        Singleton s1, s2;
        s1 = Singleton.getInstance();
        s2 = Singleton.getInstance();

        
        System.out.println(s1 == s2);
    }


}
